package com.hyzh.latte.vehicle.nezha;

import com.hyzh.latte.vehicle.dmo.PointBO;
import lombok.*;
import org.jgrapht.graph.DefaultEdge;

import java.util.List;

/**
 * @author songkui
 * @since 2024/3/20 18:28
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true, exclude = {"pointList"})
public class PoleEdge extends DefaultEdge {

    private List<PointBO>  pointList;
    private String sourcePoleCode;
    private String sourceLab;
    private String targetPoleCode;
    private String targetLab;
    private Integer distance; //距离
    private String parkCode;
    private Integer direction;  //方向

    public Object findSource(){
      return  super.getSource();
    }
    public Object findTarget(){
        return  super.getTarget();
    }


    public PoleVertex buildSourceVertex(){
        PoleVertex poleVertex = new PoleVertex();
        poleVertex.setParkCode(this.getParkCode());
        poleVertex.setPoleCode(this.sourcePoleCode);
        poleVertex.setLab(this.sourceLab);
        return  poleVertex;
    }
    public PoleVertex buildTargetVertex(){
        PoleVertex poleVertex = new PoleVertex();
        poleVertex.setParkCode(this.getParkCode());
        poleVertex.setPoleCode(this.targetPoleCode);
        poleVertex.setLab(this.targetLab);
        return  poleVertex;
    }

}
